<?php
//filename : M_V_NILAIDP3.php

require_once APPPATH.'models/gnc_db_mysql'.EXT;

class M_V_NILAIDP3 extends Gnc_db_mysql {
	protected $data_source	= 'dpt_v_nilaidpt3';
	
	function select_query($var_select=NULL,$var_where=NULL,$order_by=NULL) //select, where in format array or string 'cond="value"' order by one value
		{
			if($var_select != NULL){
				if (is_array($val_select))
				{
					$this->db->select(implode(',',$field));
				}else{
					if(!$var_select)
					{
						$this->db->select($var_select);
					}
				}
			}

			if($var_where != NULL)
			{
				if (is_array($var_where)){
					foreach($var_where as $key=>$val){
						$this->db->where($key,$val);
					}
				}else{
					$this->db->where("`".substr($var_where,0,strpos($var_where,"="))."`",substr($var_where,strpos($var_where,"=")+1));
				}
			}

			if($order_by != NULL){
				$this->db->order_by($order_by);
			}

			$query = $this->db->get($this->data_source);
			return $query->result();
		}
}


?>